Skip to content

feat: add a method to compute the DB size of the state#9

Merged
talos-bot merged 1 commit intocosi-project:mainfrom
smira:feat/dbsize
Feb 11, 2026
Merged

feat: add a method to compute the DB size of the state#9
talos-bot merged 1 commit intocosi-project:mainfrom
smira:feat/dbsize

Conversation

@smira
Copy link
Copy Markdown
Member

@smira smira commented Feb 6, 2026

@github-project-automation github-project-automation bot moved this to To Do in Planning Feb 6, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Feb 6, 2026
@smira smira requested a review from Copilot February 6, 2026 18:07
@github-project-automation github-project-automation bot moved this from In Review to Approved in Planning Feb 6, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a SQLite-state API to compute the approximate storage footprint of the state’s underlying tables, along with tests to validate the behavior as data is inserted (referenced from omni issue #2140).

Changes:

  • Introduces (*sqlite.State).DBSize(ctx) to compute table size in bytes using SQLite dbstat.
  • Adds tests asserting non-zero size for an empty DB and growth after inserting resources.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/state/impl/sqlite/size.go Adds DBSize implementation querying dbstat for resources/events table page usage.
pkg/state/impl/sqlite/size_test.go Adds tests covering empty DB and growth behavior after inserts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Part of siderolabs/omni#2140

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@oguzkilcan
Copy link
Copy Markdown
Member

/m

@talos-bot talos-bot merged commit 4a6c05e into cosi-project:main Feb 11, 2026
15 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in Planning Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants